package com.atguigu.gmall.web.controller;

import com.atguigu.gmall.common.result.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

@RestController
public class HelloTestController {
    @GetMapping("/div")
    public Result div(@RequestParam("num") Long num, HttpServletResponse response){
        Cookie jsessionxx = new Cookie("jsessionxx", "123");
        //  请求的域
        jsessionxx.setDomain(".jd.com");
        response.addCookie(jsessionxx);

        return Result.ok(10/num);
    }


}
